#!/bin/tcsh

echo "======================================"
echo "= Basic Test Script For Assignment 2 ="
echo "=      by Eric McCreath 2006         ="
echo "======================================"
echo 
echo "=> compiling truncate"
gcc -o truncate truncate.c
echo "=> compiling mkfs.vvsfs"
gcc mkfs.vvsfs.c -o mkfs.vvsfs
echo "=> make a disk image"
dd if=/dev/zero of=testvvsfs.img bs=512 count=100
echo "=> format it"
./mkfs.vvsfs testvvsfs.img
echo "=> making mount point"
mkdir testmountpoint
echo "=> loading module"
modprobe lz4_compress
insmod vvsfs.ko
echo "=> mount vvsfs"
mount -o loop -t vvsfs testvvsfs.img testmountpoint
cd testmountpoint

foreach v (test1 test2) 
echo -n "===================> "
echo -n $v
echo " <==================="
../$v | diff - ../$v.res
end

echo "=> taking everything down"
cd ..
umount testmountpoint
rmmod vvsfs
rm -rf testmountpoint
echo "=> All Done"

